program FairSquareIndexExpressBAS;

{$APPTYPE CONSOLE}

{$R *.res}

uses
  System.SysUtils,
  math,
  BigInt in 'BigInt.pas',
  BInt in 'BInt.pas';

var
  f, g: TextFile;

var
  fs: BigInteger;
  curlen, cl1: Byte;
  t: Integer;
begin
  try
    fs := BigInteger.Create;
    AssignFile(f, 'FirstAS.txt');
    Reset(f);
    AssignFile(g, 'IndexExpressAS.txt');
    Rewrite(g);
    curlen := 0;
    t := 0;
    try
      while not eof(F) do begin
        fs.readFromFile(f);
        cl1 := fs.getLen;
        if cl1 > curlen then begin
          curlen := cl1;
          writeln(g, curlen, ' ', t);
          Flush(g);
        end;
        Inc(t);
      end;
    finally
      CloseFile(f);
      CloseFile(g);
    end;
    { TODO -oUser -cConsole Main : Insert code here }
  except
    on E: Exception do begin
      Writeln(E.ClassName, ': ', E.Message);
      readln;
    end;
  end;
end.
